package com.list;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import javax.jws.Oneway;

import com.arrays.class10.Student;
import com.root.Person;

 

public class ListTest {

	
	public static void main(String[] args) {
		
		List list = new ArrayList();
		
		
		//adding String
		list.add("xyz");
		list.add("xyz");
		list.add("xyz");
		//ading student
		list.add(new Student());
		//adding String test
		list.add("test");
	    //System.out.println(list.size());
		//adding String
	    list.add("One More Test");
		
		
	    System.out.println("Getting First Element "+list.get(0).toString());
	   
	    
	    String stringObj = new String();
	    
	    if(stringObj instanceof Object)
	    {
	    	
	    	System.out.println("True");
	    	
	    }
	    
	    
	    
	    
	    
	    
	      String string = (String)list.get(1);
	      
	      System.out.println(string);
	    
	     
	    
		for (Iterator iterator = list.iterator(); iterator.hasNext();) {
			Object object = (Object) iterator.next();
			System.out.println(object.toString());
			
		}
		
		
	}
}
